package com.example.myapplication.activity;

import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import com.example.myapplication.R;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private Intent intent;
    private Toolbar toolbar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        toolbar = findViewById(R.id.tb_main);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(false);

        findViewById(R.id.bt_main_login).setOnClickListener(this);
        findViewById(R.id.bt_main_register).setOnClickListener(this);
        findViewById(R.id.bt_main_teams).setOnClickListener(this);
        findViewById(R.id.bt_main_team_detail).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bt_main_login:
                intent = new Intent(this,LoginActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_main_register:
                intent = new Intent(this,RegisterActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_main_teams:
                intent = new Intent(this,TeamsActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_main_team_detail:
                intent = new Intent(this,TeamDetailActivity.class);
                startActivity(intent);
                break;
        }
    }
}
